SRC_DIR      = ./ 
EXTRA_CFLAGS = -I ../

# Drivers
EXTRA_CFLAGS += -DCONFIG_IRQCTRL_BASE=0x90000000
EXTRA_CFLAGS += -DSD_CTRL_BASE=0x96000000
EXTRA_CFLAGS += -DINCLUDE_SD_CARD_DRIVER
EXTRA_CFLAGS += -DCONFIG_SD_MULTI_READ
EXTRA_CFLAGS += -DCONFIG_JPEG_HW
EXTRA_CFLAGS += -DCONFIG_IRQCTRL
EXTRA_CFLAGS += -DCONFIG_FRAMEBUFFER
EXTRA_CFLAGS += -DCONFIG_UARTLITE
EXTRA_CFLAGS += -DCONFIG_UARTLITE_BASE=0x92000000
EXTRA_CFLAGS += -DCONFIG_UARTLITE_CONSOLE
EXTRA_CFLAGS += -DCONFIG_NO_RPC_SUPPORT
EXTRA_CFLAGS += -DCPU_KHZ=60000

EXTRA_CFLAGS += -DCONFIG_FB_DEV_BASE=0x95000000
EXTRA_CFLAGS += -DCONFIG_AUDIO_BASE=0x93000000

EXTRA_CFLAGS += -DCONFIG_SCREEN_WIDTH=1280
EXTRA_CFLAGS += -DCONFIG_SCREEN_HEIGHT=720

# RTOS
SRC_DIR     += ../rtos
SRC_DIR     += ../rtos/arch/riscv
SRC_DIR     += ../rtos/kernel
EXTRA_CFLAGS += -DINCLUDE_MUTEX
EXTRA_CFLAGS += -DINCLUDE_SEMAPHORE
EXTRA_CFLAGS += -DINCLUDE_MAILBOX
EXTRA_CFLAGS += -DINCLUDE_EVENTS
EXTRA_CFLAGS += -DPLATFORM_IDLE_TASK_STACK=1024
EXTRA_CFLAGS += -DINCLUDE_RTOS
EXTRA_CFLAGS += -DMCU_CLK=60000000

# FATFS
SRC_DIR += ../fs/fatfs/src
EXTRA_CFLAGS+= -DFATFS_INC_TEST_HOOKS

# MP3 Codec
EXTRA_CFLAGS+= -DINCLUDE_MP3_SUPPORT
SRC_DIR     += ../mp3/real
SRC_DIR     += ../mp3/pub
SRC_DIR     += ../mp3

# LIB: printf, etc
SRC_DIR     += ../lib
EXTRA_CFLAGS+= -DCONFIG_MALLOC
EXTRA_CFLAGS+= -DCONFIG_MALLOC_SIZE=131072

# LVGL Library
EXTRA_CFLAGS+= -DLV_CONF_INCLUDE_SIMPLE
LVGL_DIR_NAME ?= lvgl
LVGL_DIR ?= ../
EXTRA_CFLAGS+= -I$(LVGL_DIR)/
include $(LVGL_DIR)/lvgl/lvgl.mk
EXTRA_SRC:= $(sort $(ASRCS) $(CSRCS) $(MAINSRC))

MEM_SIZE=0x3000000
OPT = 2

TARGET=boot
ARCH=riscv

MAKE_DIR=../make
include $(MAKE_DIR)/makefile.exe